package com.bdqn;

import com.bdqn.hello.HelloSpring;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * TestHelloSpring
 *
 * @author LILIBO
 * @since 2024/7/13
 */
public class TestHelloSpring {

    public static void main(String[] args) {
        // 加载Spring上下文环境
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        // 从Spring环境中获取一个Beans实例
        HelloSpring helloSpring = (HelloSpring) context.getBean("helloSpring");
        System.out.println(helloSpring.getHello());
        helloSpring.print();
    }

}
